body, html {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    align-items: center;
}

main {
    width: 100%;
    max-width: 600px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: auto;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative; /* Establishes a positioning context for absolute children */
}

h1 {
    text-align: center;
    margin-top: 0;
}

#chat-container {
    flex-grow: 1; /* Takes up the available space */
    padding: 10px;
    max-height: calc(100vh - 120px); /* Adjust the 120px to account for other elements like header and input-container */
    overflow-y: auto; /* Enable vertical scroll if needed */
}

#messages {
    display: flex;
    flex-direction: column;
}

.message {
    padding: 5px 10px;
    margin-bottom: 2px;
    border-radius: 10px;
    max-width: 90%; /* Limit the width to 90% of the container */
    word-wrap: break-word; /* Break long words to prevent overflow */
    overflow-wrap: break-word; /* Ensures that long unbroken strings of text will wrap */
}

.user-message {
    background-color: #dcf8c6;
    align-self: flex-end;
}

.server-message {
    background-color: #f2f2f2;
    align-self: flex-start;
}

#input-container {
    /* Removed margin-top: auto; */
    width: 100%; /* Match the width of the main container */
}

#chat-controls {
    padding: 10px;
    display: flex;
    background: white;
}

#messageInput {
    flex-grow: 1;
    padding: 10px;
    margin-right: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-sizing: border-box; /* Ensures padding is included in the width */
}

#sendButton {
    padding: 10px 20px;
    background-color: #5cb85c;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

#sendButton:hover {
    background-color: #4cae4c;
}

pre code {
    background-color: #f4f4f4; /* light gray background */
    border: 1px solid #ddd;
    padding: 5px;
    border-radius: 3px;
    display: block;
    /* ... other styles for code blocks ... */
}

